package demo12;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class test8 {
    public static void main(String[] args) throws IOException {
        Reader reader = new FileReader("d:/mma.txt");
        //一次读取一个字符
        while(true) {
            //n代表读取到的字符的unicode编码
            int n = reader.read();
            System.out.println("n = " + n);
            if(n == -1) {
                break;
            }
            char ch = (char)n;
            System.out.println(ch + " ");
        }
    }
}
